﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChainAnalises.Classes.DivizionToAccords.AuxiliaryClasses;

namespace Segmentator.Dividers
{
    class EntryCollector
    {
        private List<IDataForStd> _data_for_std = new List<IDataForStd>();
        private List<int> _word_length = new List<int>();

        public  EntryCollector()
        {
            _data_for_std = new List<IDataForStd>();
            _word_length = new List<int>();
        }
        public void Add(IDataForStd dataForStd, int length)
        {
            _data_for_std.Add(dataForStd);
            _word_length.Add(length);
        }

        public int Size()
        {
            return _data_for_std.Count;
        }

        public void Remove(int index)
        {
            if (index >= 0 && index <= (Size() - 1))
            {
                _data_for_std.RemoveAt(index);
                _word_length.RemoveAt(index);
            }
        }

        public IDataForStd GetStd(int index)
        {
            if (index >= 0 && index <= (Size() - 1)) return _data_for_std[index];
            return null;
        }
        public int GetLength(int index)
        {
            if (index >= 0 && index <= (Size() - 1)) return _word_length[index];
            return -1;
        }
        
    }
}
